package com.xinqi.modules.prepare.video.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.prepare.video.dto.req.PrepareVideoCreateDTO;
import com.xinqi.modules.prepare.video.dto.req.PrepareVideoQueryDTO;
import com.xinqi.modules.prepare.video.dto.req.PrepareVideoUpdateDTO;
import com.xinqi.modules.prepare.video.dto.rsp.PrepareVideoResultDTO;
import com.xinqi.modules.prepare.video.factory.PrepareVideoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 备课区互动视频客户端
 *
 * @author: system
 * @date: 2023/03/19
 */
@FeignClient(value = ServiceNameConstants.XQ_PREPARE, fallbackFactory = PrepareVideoFallbackFactory.class)
public interface PrepareVideoClient {

    /**
     * 备课区互动视频-分页
     */
    @GetMapping("/prepare-video/page")
    R<PageInfo<PrepareVideoResultDTO>> page(PrepareVideoQueryDTO dto);

    /**
     * 备课区互动视频-详情
     */
    @GetMapping("/prepare-video/{id}")
    R<PrepareVideoResultDTO> findById(@PathVariable("id") Long id);

    /**
     * 新增备课区互动视频
     */
    @PostMapping("/prepare-video")
    R<Long> insert(@RequestBody PrepareVideoCreateDTO dto);

    /**
     * 修改备课区互动视频
     */
    @PutMapping("/prepare-video/{id}")
    public R<Boolean> update(@PathVariable("id") Long id, @RequestBody PrepareVideoUpdateDTO dto);

    /**
     * 删除备课区互动视频
     */
    @DeleteMapping("/prepare-video/{id}")
    R<Boolean> delete(@PathVariable("id") Long id);

}
